--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit fc9e1bf86fede090efc520821656594ba182da41
Parents : ef0aed5
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-11-03T13:37:48+01:00
Added call confirm dialog
Changes
2 files changed, 23 insertions(+), 2 deletions(-)
Diff
diff --git a/sbapp/main.py b/sbapp/main.py
index dd8a6b63..7853fb88 100644
--- a/sbapp/main.py
+++ b/sbapp/main.py
@@ -1802,8 +1802,26 @@ class SidebandApp(MDApp):
elif sender.conv_type == self.sideband.CONV_VOICE:
identity_hash = sender.sb_uid
- def cb(dt): self.dial_action(identity_hash)
- Clock.schedule_once(cb, 0.15)
+ if not self.sideband.config["confirm_calls"]:
+ def cb(dt): self.dial_action(identity_hash)
+ Clock.schedule_once(cb, 0.15)
+ else:
+ call_dialog_text = f"[b]Initiate Voice Call?[/b]\n\nDestination Identity:\n{RNS.prettyhexrep(identity_hash)}?"
+ if hasattr(self, "confirm_call_dialog"): self.confirm_call_dialog.text = call_dialog_text
+ else:
+ yes_button = MDRectangleFlatButton(text="Call",font_size=dp(18), theme_text_color="Custom", line_color=self.color_accept, text_color=self.color_accept)
+ no_button = MDRectangleFlatButton(text="Cancel",font_size=dp(18))
+ self.confirm_call_dialog = MDDialog(text=call_dialog_text, buttons=[ no_button, yes_button ])
+ def dl_no(s): self.confirm_call_dialog.dismiss()
+ def dl_yes(s):
+ self.confirm_call_dialog.dismiss()
+ def cb(dt): self.dial_action(self.confirm_call_dialog.dest_identity_hash)
+ Clock.schedule_once(cb, 0.15)
+
+ yes_button.bind(on_release=dl_yes)
+ no_button.bind(on_release=dl_no)
+ self.confirm_call_dialog.dest_identity_hash = identity_hash
+ self.confirm_call_dialog.open()
def open_conversation(self, context_dest, direction="left"):
self.rec_dialog_is_open = False
diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py
index 05688530..b653492f 100644
--- a/sbapp/sideband/core.py
+++ b/sbapp/sideband/core.py
@@ -475,6 +475,7 @@ class SidebandCore():
self.config["lxm_limit_1mb"] = True
self.config["trusted_markup_only"] = False
self.config["compose_in_markdown"] = False
+ self.config["confirm_calls"] = True
# Connectivity
self.config["connect_transport"] = False
@@ -652,6 +653,8 @@ class SidebandCore():
self.config["trusted_markup_only"] = False
if not "compose_in_markdown" in self.config:
self.config["compose_in_markdown"] = False
+ if not "confirm_calls" in self.config:
+ self.config["confirm_calls"] = True
if not "input_language" in self.config:
self.config["input_language"] = None
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────